LCC ("Local C Compiler" or "Little C Compiler") is a small retargetable compiler program for the ANSI C programming language. It is available at no charge for personal use but is not free software.[1] It was developed by Chris Fraser and David Hanson. id Software's computer game Quake III relies on a modified version of LCC to compile source code for its virtual machine.
Contents |
LCC is simple to understand and well-documented. Its design is described in Fraser and Hanson's book A Retargetable C Compiler: Design and Implementation. The book includes most of the source code for version 3.6 of the compiler, which was written as a literate program using noweb. As of July 2011 the current version of LCC is 4.2, but much of the book still applies to this version. The major change since the book was published is in the code-generator interface, which is described in a separate document.[2]
The source code for LCC is around 20,000 lines, much smaller than many other compilers.[3] The Tiny C Compiler is one of the few compilers smaller than LCC.
LCC is frequently preferred over GCC -- on PC/Windows platforms because LCC-Win32 comes with a nice graphical IDE, and on new platforms LCC is easier to port than GCC.[4]
LCC can generate code for several processor architectures, including Alpha, SPARC, MIPS, and x86 (PCs); there is also an LCC backend that generates Microsoft's Common Intermediate Language.
The Lcc-win32 or LccWin32 system is a full featured C Development Environment for the Microsoft Windows operating system, written by Jacob Navia. He continued the work of Hanson and Fraser, who wrote the original LCC compiler.
It features:
Under development - can currently successfully compile itself, the IDE (wedit64) and around 550 test files. lcc-win64 will also feature more advanced code optimizations.
LCC is free for personal use and may be redistributed with attribution. LCC may not be sold for profit, but it may be included with other software that is sold for profit.[1]